<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/templates/common/taglib.jsp"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>${title}</title>
    <link rel="stylesheet" href="${basePath}/static/bootstrap/css/bootstrap.css"/>
    <link href="${basePath}/static/css/basic.css" rel="stylesheet" type="text/css">
    <link href="${basePath}/static/css/login.css" rel="stylesheet" type="text/css">
    <link href="${basePath}/static/css/list.css" rel="stylesheet" type="text/css">
    <script  type="text/javascript" src="${basePath}/static/js/jquery.min.js"></script>
	<script  type="text/javascript" src="${basePath}/static/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="${basePath}/static/page/jqPaginator/jqPaginator.js"></script>
    <script  type="text/javascript" src="${basePath}/static/layer/layer.js"></script>
    <link href="${basePath}/static/layer/layer_style.css" rel="stylesheet" type="text/css">
</head>
<body>
<!--头部-->
	<%@include file="/WEB-INF/templates/common/header.jsp"%>
	<!------导航条-->
	<%@include file="/WEB-INF/templates/common/navigation.jsp"%>
<!--内容部分-->
<div class="list_main lay_out" class="clearfix">
    <div class="list_DH">
        <%@include file="/WEB-INF/templates/common/qualityNav.jsp"%>
    </div>
    <div class="list_NR">
        <div class="loc">
            <h3 style="margin:0 0;width:auto;">质控首页</h3>
        </div>
        <div class="list_con_table">
            <div class="search_table">
                <ul class="clearfix"style="margin-bottom:0;">
                    <input class="input_box" type="hidden"   name='' id='firstGuid' value='${medicalRecord.firstGuid}' />
                    <li class="Label_1">身份证号：&nbsp;</li>
                    <li class="Label_2"><input class="input_box" type="text" disabled="disabled"  name='' id='idCard' value='${medicalRecord.idNumber}' /></li>
                    <li class="Label_1">识别码：&nbsp;</li>
                    <li class="Label_2"><input class="input_box" type="text"  disabled="disabled" name='' id='mrId' value='${medicalRecord.mrId}' /></li>
                    <li class="Label_1">姓名：&nbsp;</li>
                    <li class="Label_2"><input class="input_box" type="text"  name='' id='name' value='${medicalRecord.name}' /></li>
                    <li class="Label_1" style="height:114px;line-height:114px;">质控项目：&nbsp;</li>
                    <li class="Label_2" style="height:114px;">
                        <select class="input_box" onchange="getSecondProject()" name="" id="firstPro">
                            <option value="">病案首页项目</option>
                        </select>
                        
                        <select class="input_box" onchange="thirdProject()" name="" id="secondPro">
                            <option value="">病案首页</option>
                           
                        </select>
                        
                        <select class="input_box" onchange="getProjectMsg()"  name="" id="thirdPro">
                            <option value="">某项未填写、填写不规范、填写错误</option>
                        </select>
                    </li>
                    <li class="Label_1" style="height:114px;line-height:114px;">质控内容：&nbsp;</li>
                    <li class="Label_2" style="width:53%;height:114px;padding-left:2px;">
                      <textarea id="medControlDesc" style="word-break:break-all; width:100%;height:100px;margin-top:9px;"></textarea>
                    </li>
                    <li class="Label_5">
                        <div class="right" style="text-align:right" id="opeBtn">
                            <a id="Add" onclick="addQuality()">新增</a>
                        </div>
                    </li>
                </ul>
            </div>
			   <table class="Search_tableList" cellpadding="0" cellspacing="0">
                <tr>
                    <td class="tdLabel_4">姓名</td>
                    <td class="tdLabel_4">识别码</td>
                    <td class="tdLabel_4">出院科室</td>
                    <td class="tdLabel_4">质控项目</td>
                    <td class="tdLabel_4">质控内容</td>
                    <td class="tdLabel_4">质控人</td>
                    <td class="tdLabel_4">操作</td>
                </tr>  
                <tbody id="tbody"></tbody>
             	 <c:forEach items="${qualityList}" var="qualityMap">
				<tr>
                    <td class="tdLabel_5">${qualityMap.name}</td>
                    <td class="tdLabel_5">${qualityMap.mrId}</td>
                    <td class="tdLabel_5">${qualityMap.outOfficeName}</td>
                    <td class="tdLabel_5">${qualityMap.project}</td>
                    <td class="tdLabel_5">${qualityMap.qualityDes}</td>
                    <td class="tdLabel_5">${qualityMap.qualityName}</td>
                  
	                <td class="tdLabel_5">
	                   <a class="int" mqcId="${qualityMap.medQuaFunId}"  mqId="${qualityMap.mqId}" onclick="deleteQuality(this)">删除</a>
	                </td>
                   
                </tr>  
             	</c:forEach> 
            </table> 
        </div>
    
    </div>

</div>
<!------页脚部分--------->
<%@include file="/WEB-INF/templates/common/footer.jsp"%>

<!--JS部分-->
<script type="text/javascript">
   function addQuality(){
	   var firstGuid=$("#firstGuid").val();
	   var medControlDesc=$("#medControlDesc").val();
	 //alert(medControlDesc);
	   //质控首页中质控扣分默认为0，质控项目默认为99999
	   var qcDockPoints=0;
	   var firstProId=1;
	   var secondProId=100;
	   var thirdProId=10001;
	   if(medControlDesc==null || medControlDesc==''){
		   alert("首页质控描述不能为空!");
		   return;
	   }
	   $.ajax({
		   type:"post",
		   url:'${basePath}/quality/addFirstMedQuality',
           data:{qcDockPoints:qcDockPoints,firstGuid:firstGuid,medControlDesc:medControlDesc,firstProId:firstProId,secondProId:secondProId,thirdProId:thirdProId},
		   success:function(data){
			   window.location.href="${basePath}/quality/qualityHomepageDetail?firstGuid="+firstGuid;
		   }
	   })
   }
   
   //删除质控信息
   function deleteQuality(obj){
   	
   	var mqcId=$(obj).attr("mqcId");
   	var mqId=$(obj).attr("mqId");
   	$.ajax({
   		type:"post",
   		url:"${basePath}/quality/deleteQuality",
   		data:{mqcId:mqcId,mqId:mqId},
   		success:function(data){
   			console.log(data);
   			if(data.success){
	    			$(obj).parents("tr").fadeOut("slow",function(){
						$(this).remove();
					});
   				
   			}else{
   				
   			}
   		}
   	})
   }
   
</script>

</body>
</html>